cmake_minimum_required(VERSION 3.19)
project(rtkpost)

set(CMAKE_C_STANDARD 11)
add_link_options(-lm)

include_directories(src)
file(GLOB_RECURSE SOURCES src/*.c src/rcv/*.*)
set(HEADER src/rtklib.h)

add_executable(rtkpost rnx2rtkp.c ${SOURCES})
target_link_libraries(rtkpost pthread glog)

add_library(rtklib STATIC ${SOURCES} )
target_link_libraries(rtklib pthread)


message("include dir:${CMAKE_INSTALL_PREFIX}/include")
install(FILES ${HEADER}  DESTINATION  ${CMAKE_INSTALL_PREFIX}/include)
install(TARGETS  rtkpost rtklib
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
        )
add_executable(time_covert time_covert.cpp  ${SOURCES})
target_link_libraries(time_covert pthread glog)

